<?php
namespace app\index\controller;
use think\Controller;
use think\Db;
use think\Cache;
class PicLists extends Common {
	
	public function index(){
		$id = (int) request()->param('cid');
		$cate = Db::name('category')->where(['id'=>$id])->find();
		if(!isset($cate['template_list'])){
			return $this->fetch(config('template.default_them').'/404');
		}
		$list = Db::name('picture')->where(['cid'=>$id])->paginate(10, false, ['query' => request()->param()]);
		// p($list);die;
		if(!$list){
			return $this->fetch(config('template.default_them').'/404');
		}
		
		// p($list);
		$this->assign('list', $list);
		return $this->fetch('template/'.config('template.default_them').'/'.$cate['template_list']);
	}
}